import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter)
import Mobile from '@/view/Mobile.vue'
import MobileHome from '@/view/mobile/MobileHome.vue'
import MobileHeader from '@/components/mobile/default/MobileHeader.vue'
import MobileFooter from '@/components/mobile/default/Mobilefooter.vue'
import MobileMyHome from '@/view/mobile/MobileMyHome.vue'
import MobileBooksList from '@/view/mobile/MobileBooksList.vue'
import MobileHomeList from '@/components/mobile/home/MobileHomeList.vue'
import MobileBooksDetail from '@/view/mobile/MoileBooksDetail.vue'
import MobileSearch from '@/view/mobile/MobileSearch.vue'
import Home from '@/view/pc/Home.vue'
import BookBackend from '@/view/pc/BookBackend.vue'
import endbacklist from '@/view/backend/endbacklist.vue'
import endbackRole from '@/view/backend/endbackRole.vue'
import endbackType from '@/view/backend/endbackType.vue'
import formCountry from '@/view/backend/formCountry.vue'
import endHead from '@/view/pc/model/endHead.vue'
import endfoot from '@/view/pc/model/endfoot.vue'
import endAddAndUpdate from '@/view/pc/model/endAddAndUpdate.vue';
import order from '@/view/backend/endBackOrder.vue'
import login from '@/view/pc/model/login.vue'
import moblielogin from '@/view/mobile/MobileLogin.vue'
import moblieshop from '@/view/mobile/MobliefindMyShop.vue'
import AdminLogin from '@/components/admin/AdminLogin.vue'
import mobliegoorder from '@/view/mobile/Mobliegoorder.vue'
import mobliedoorder from '@/view/mobile/Mobliedoorder.vue'
import moblieupdatepwd from '@/view/mobile/Moblieupdatepwd.vue'
import moblieupdateimg from '@/view/mobile/Moblieupdateimg.vue'
import endbackupdateshop from '@/view/backend/endbackupdateshop.vue'
import endbackaddshop from '@/view/backend/endbackaddshop.vue'
import roletype from '@/view/backend/roleupdate.vue'
import addtwo from '@/view/backend/addtwo.vue'
import updatetwo from '@/view/backend/updatetwo.vue'
import flyorder from '@/view/backend/flyorder.vue'
import hometype from '@/view/pc/model/HomeType.vue'
import addAdmin from '@/view/pc/model/addAdmin.vue'
import updateAdmin from '@/view/pc/model/updateAdmin.vue'

import updateAdminPwd from '@/view/pc/model/updateAdminPwd.vue'
import updateAdminImg from '@/view/pc/model/updateAdminImg.vue'
import updateAdminAddr from '@/view/pc/model/updateAdminAddr.vue'
import pcshopCar from '@/view/pc/model/pcshopCar.vue'
import pcgoOrder from '@/view/pc/model/pcgoOrder.vue'
import pcdoOrder from '@/view/pc/model/pcdoOrder.vue'
import pcdoOrder2 from '@/view/pc/model/pcdoOrder2.vue'
import myOrder from '@/view/pc/model/myOrder.vue'
import allbook2 from '@/view/pc/model/allbook2.vue'
import allbook3 from '@/view/pc/model/allbook3.vue'
import lookBook from '@/view/pc/model/lookBook.vue'
import Head from '@/view/pc/default/pcHead.vue'
const routes = [{
		path: '/',
		/* redirect: {
			name: Home
		} */
		redirect: '/home'
	},
	{
		path: '/home',
		name: 'home',
		component: Home,

	},
	{
		path: '/login',
		component: login
	},
	{
		path: '/addAdmin',
		component: addAdmin
	},
	{
		path: '/pcshopCar',
		component: pcshopCar
	},
	{
		path: '/pcgoOrder',
		component: pcgoOrder
	},
	{
		path: '/myOrder',
		component: myOrder
	},
	{
		path: '/pcdoOrder',
		component: pcdoOrder
	},
	{
		path: '/pcdoOrder2',
		component: pcdoOrder2
	},
	{
		path: '/lookBook',
		component: lookBook
	},
	{
		path: '/updateAdmin',
		component: updateAdmin,
		children: [{
			path: "updateAdminPwd",
			component: updateAdminPwd
		}, {
			path: "updateAdminImg",
			component: updateAdminImg
		}, {
			path: "updateAdminAddr",
			component: updateAdminAddr
		}, ]
	},
	{
		path: '/hometype',
		component: hometype,
		children: [{
			path: "allbook2",
			component: allbook2,

		}]
	},


	{
		path: '/bookbackend',
		name: 'backend',
		component: BookBackend,
		children: [{
				path: 'endbacklist',
				name: 'hotlist',
				component: endbacklist,
			}, {
				path: 'endbackTypeOne',
				name: 'backType1',
				component: endbackRole,

			},
			{
				path: 'endbackTypeTwo',
				name: 'backType2',
				component: endbackType,


			},
			{
				path: 'shoplist',
				name: 'shoplist',
				component: formCountry,

			},
			{
				path: 'endbackOrder',
				name: 'order',
				component: order,

			}, {
				path: 'addAndupdate',
				name: 'AddAndUpdate',
				component: endAddAndUpdate
			},
			{
				path: 'endbackupdateshop',
				name: 'endbackupdateshop',
				component: endbackupdateshop
			},
			{
				path: 'endbackaddshop',
				name: 'endbackaddshop',
				component: endbackaddshop
			},
			{
				path: 'roleupdate',
				name: 'roleupdate',
				component: roletype,

			},
			{
				path: 'updatetwo',
				name: 'updatetwo',
				component: updatetwo,
			},
			{
				path: 'addtwo',
				name: 'addtwo',
				component: addtwo,
			}, {
				path: 'flyorder',
				name: 'fly',
				component: flyorder,
			}
		]
	}, {
		path: '/mobile',
		name: 'Mobile',
		component: Mobile,
		children: [{
				path: 'home',
				name: 'MobileHome',
				//  下面所使用的是, 命名视图的方式  与 router - view 的 name 属性匹配组件
				components: {
					default: MobileHome, //  渲染到没有name 属性的 router - view 上
					header: MobileHeader,
					footer: MobileFooter
				}
			}, {
				path: 'booklist',
				name: 'MobileBookslist',
				components: {
					default: MobileBooksList,
					header: MobileHeader,
					footer: MobileFooter
				},

			}, , {
				path: 'myhome',
				name: 'myhome',
				components: {
					default: MobileMyHome,
					header: MobileHeader,
					footer: MobileFooter
				},

			}, {
				path: 'booksdetail/:bookid',
				name: 'MobileBookDetail',
				component: MobileBooksDetail
			}, {
				path: 'search',
				name: 'MobileSearch',
				component: MobileSearch
			}, {
				path: 'moblielogin',
				name: 'login',
				component: moblielogin
			}, {
				path: 'moblieshop',
				name: 'shop',
				component: moblieshop
			}, {
				path: 'mobliegoorder',
				name: 'order',
				component: mobliegoorder
			},
			{
				path: 'mobliedoorder',
				name: 'doorder',
				component: mobliedoorder
			},
			{
				path: 'moblieupdatepwd',
				name: 'pwd',
				component: moblieupdatepwd
			},
			{
				path: 'moblieupdateimg',
				name: 'img',
				component: moblieupdateimg
			},
		]

	},

];
var rou = new VueRouter({
	routes
})
export default rou;